package com.study.method;

public class CaseDemo3 {
    public static void main(String[] args) {
        // 需求：如果两个数组的类型、元素个数、元素顺序以及内容都一样的话那么我们就可认定俩数组一样
        int[] arr1 = {11,22,33,44};
        int[] arr2 = {11,22,33,44};
        int[] arr3 = {11,21,33,44};
        System.out.println(compare(arr1,arr2));
        System.out.println(compare(arr1,arr3));
        System.out.println(compare(arr2,arr3));

    }
    public static boolean compare(int[] arr1,int[] arr2) {
        if (arr1.length == arr2.length) {
            for (int i = 0; i < arr1.length; i++) {
                if (arr1[i] != arr2[i]){
                    return false;
                }
            }
        } else {
            return false;
        }
        return true;
    }
}
